package com.jvtd.eyl.widget.adapter;

import android.databinding.ViewDataBinding;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.widget.FrameLayout;
import android.widget.ImageView;

import com.jvtd.eyl.BR;
import com.jvtd.eyl.R;
import com.jvtd.eyl.bean.binding.PeriodicalBean;
import com.jvtd.utils.UiUtils;
import com.jvtd.widget.adapter.JvtdQuickAdapter;
import com.jvtd.widget.adapter.viewHolder.JvtdViewHolder;
import com.jvtd.widget.imageView.JvtdRcImageView;
import com.sxu.shadowdrawable.ShadowDrawable;

import java.util.ArrayList;
import java.util.List;

/**
 * 分类下期刊列表条目
 *
 * 作者:chenlei
 * 时间:2018/11/13 4:58 PM
 */
public class ClassPeriodicalAdapter extends JvtdQuickAdapter<PeriodicalBean,JvtdViewHolder> {
    public ClassPeriodicalAdapter() {
        super(R.layout.adapter_class_periodical, new ArrayList<>());
    }

    @Override
    protected void convert(JvtdViewHolder helper, PeriodicalBean item) {
        ViewDataBinding binding = helper.getBinding();
        binding.setVariable(BR.itemBean, item);
        binding.executePendingBindings();

//        ImageView imageView = helper.getView(R.id.iv_periodical);
//        FrameLayout frameLayout = helper.getView(R.id.fl_shadow);
//        ShadowDrawable.setShadowDrawable(frameLayout,UiUtils.dp2px(mContext,5), ContextCompat.getColor(mContext,R.color.color_shadow), UiUtils.dp2px(mContext,4), 0, 0);
//        int itemWidth = Math.min((UiUtils.windowWidth(mContext) - UiUtils.dp2px(mContext,88))/2 - UiUtils.dp2px(mContext, 16) * 2, UiUtils.dp2px(mContext, 96.f));
//        UiUtils.setAutoHeight(imageView,itemWidth,96.f / 132.f);
    }
}
